package com.hmdp.controller;

import com.hmdp.dto.Result;
import com.hmdp.service.OrderService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/test")
public class TestController {

    @Resource
    public OrderService orderService;

    @PostMapping("/create")
    public Result create(@RequestParam(value = "orderID")String orderID) {
        orderService.createOrder(orderID);
        return Result.ok();
    }

    @PostMapping("/confirm")
    public Result confirm(@RequestParam(value = "orderID")Long orderID) {
        orderService.confirmOrder(orderID);
        return Result.ok();
    }
}
